package entity;
import java.util.*;

import enums.AdapterEnum;
import enums.CompositeEnum;
import enums.DecoratorEnum;

public class PatternRoleVector {
	
	public PatternRoleVector(){
//		adapterTarget = false;
//		adapterAdapter = false;
//		adapterAdaptee = false;
//		compositeComponent = false;
//		compositeComposite = false;
//		compositeLeaf = false;
//		decoratorComponent = false;
//		decoratorConcreteComponent = false;
//		decoratorDecorator = false;
//		decoratorConcreteDecorator = false;
		
	}
	
	public static String getVector(Set<Enum> roles){
		int[] vector;
		vector = new int[10];
		for(int i=0; i<vector.length;i++){
			vector[i]=0;
		}
		
		for(Enum r : roles){
			if(r.equals(AdapterEnum.Target)){
				vector[0]=1;
			}else if(r.equals(AdapterEnum.Adapter)){
				vector[1]=1;
			}else if(r.equals(AdapterEnum.Adaptee)){
				vector[2]=1;
			}else if(r.equals(CompositeEnum.Component)){
				vector[3]=1;
			}else if(r.equals(CompositeEnum.Composite)){
				vector[4]=1;
			}else if(r.equals(CompositeEnum.Leaf)){
				vector[5]=1;
			}else if(r.equals(DecoratorEnum.Component)){
				vector[6]=1;
			}else if(r.equals(DecoratorEnum.ConcreteComponent)){
				vector[7]=1;
			}else if(r.equals(DecoratorEnum.Decorator)){
				vector[8]=1;
			}else if(r.equals(DecoratorEnum.ConcreteDecorator)){
				vector[9]=1;
			}
		}
		String retString = "";
		for(int i=0; i< vector.length; i++){
			if(i!=vector.length-1){
				retString += (vector[i]+",");
			}else{
				retString += (vector[i]+"\n");
			}	
		}
		
		return retString;
	}
	
	
}
